package br.com.exceptiongroup.chatexception.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import br.com.exceptiongroup.chatexception.model.BaseBean;
import br.com.exceptiongroup.chatexception.persistence.GenericDAO;

public abstract class BaseService<T extends BaseBean> {
	
	@Autowired
	private GenericDAO<T> dao;
	
	public void save(T entity) {
		dao.add(entity);
	}
	
	public List<T> listAll() {
		return dao.getAll();
	}
	
	public GenericDAO<T> getDao() {
		return dao;
	}

	public void setDao(GenericDAO<T> dao) {
		this.dao = dao;
	}
	
}
